if(window.Worker) {
	msg.innerHTML = '当前浏览器可以使用web worker';
} else {
	msg.innerHTML = '当前浏览器不可以使用web worker';
}
var myWorker = new Worker('worker.js');

first.onchange = function() {
	myWorker.postMessage([first.value, second.value]);
	console.log('Message posted to worker');
}

second.onchange = function() {
	myWorker.postMessage([first.value, second.value]);
	console.log('Message posted to worker');
}

myWorker.onmessage = function(e) {
	result.textContent = e.data;
	console.log('Message received from worker');
}

btnStop.onclick=function () {
	myWorker.terminate();
}